<template>
  <div class="child">
    <h3>子组件</h3>
		<h4>我的手机:{{ phone }}</h4>
		<h4>父亲给的汽车:{{ car }}</h4>
		<button @click="sendPhone(phone)">把手机给父亲</button>
  </div>
</template>

<script setup lang="ts" name="Child">
	import {ref,defineProps} from "vue"
	//数据
	let phone=ref("苹果8")
	//接收父亲传递的数据
	defineProps(["car","sendPhone"])
</script>

<style scoped>
	.child{
		background-color: skyblue;
		padding: 10px;
		box-shadow: 0 0 10px black;
		border-radius: 10px;
	}
</style>
